#include "query.h"
#include "ui_query.h"
#include <QSqlTableModel>
#include <QDebug>
query::query(QWidget *parent) :
    QWidget(parent),
    ui(new Ui::query)
{
    ui->setupUi(this);
    modl = new QSqlTableModel();
    connect(ui->tableView,&QTableView::clicked,this,[this](const QModelIndex &index){


           qDebug() << "Cell clicked at row:"<<index.row()  << ", column:"  <<index.column() ;
    });

}

query::~query()
{
    delete ui;
}

void query::on_bto_query_clicked()
{
    if(ui->employeet->isChecked())
    {
    modl->setTable("employee");
    }else{

    }
    modl->select();
    ui->tableView->setModel(modl);
}
